﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RayTracing
{

    class BasicScene : Scene
    {

        // Camera variables
        Camera camera = new Camera(Main.camera.pos, Main.camera.hpr);

        public Color backGroundColor;

        // Lights in Scene        
        public AmbientLight ambientLight;
        public DirectionalLight directionalLight;
        public PointLight pointLight;

        //Geometries
        Geometry sphere;
        Geometry sphere2;

        //Textures
        Texture uv;
        Texture green;
        Texture red;

        //Skins
        Skin nonreflective;
        Skin mirror;

        // Scene Objecets
        SceneObject greenSphere;
        SceneObject sphereObj;

        SceneObject tri;


        public override string sceneName()
        {
            return "Basic Scene";
        }

        public override void createScene(out List<SceneObject> objects, out List<Light> lights,out Camera camera, float time, float slider1, float slider2, float slider3, float slider4, float slider5)
        {
            // every scene needs these two lines
            objects = new List<SceneObject>();
            lights = new List<Light>();

            // Camera variables
            camera = new Camera(Main.camera.pos, Main.camera.hpr);
            backGroundColor = Color.BLACK;

            // Lights in Scene
            ambientLight = new AmbientLight(new Color(.6f, .6f, .6f));
            if (Main.animate)
            {
                directionalLight = new DirectionalLight(new P3(time, -.05f, .02f), new Color(1.8f, 1.8f, 1.8f));
            }
            else
            {
                directionalLight = new DirectionalLight(new P3(slider1, slider3, slider2), new Color(1.8f, 1.8f, 1.8f));
            }
            //Console.Out.WriteLine(time);
            pointLight = new PointLight(new P3(slider1, slider3, slider2),new Color(1.3f,1.3f,1.3f));

            //add Lights to the lights list
            lights.Add(ambientLight);
            lights.Add(directionalLight);
            //lights.Add(pointLight);

            //geometries
            sphere = new Sphere(new P3(0, 9, 2), 1);
            sphere2 = new Sphere(new P3(-2, 10, -2), 1);

            //textures
            uv = new ImageTexture(Properties.Resources.uvImage);
            green = new SolidTexture(Color.GREEN);
            red = new SolidTexture(Color.RED);

            //skins
            nonreflective = new NonReflective();
            mirror = new Mirror();

            // Scene Objects
            greenSphere = new SceneObject(sphere, red, nonreflective);
            sphereObj = new SceneObject(sphere2, uv, nonreflective);

            //add objects to theScene
            objects.Add(greenSphere);
            objects.Add(sphereObj);

        }

        public override String[] SliderLabels()
        {
            String[] sliderLabels = { "Dlight X", "Dlight Z", "Dlight Y", "Not Used", "Not Used" };
            return sliderLabels;
        }

        public override AnimationParamaters getAnimationParamaters()
        {
 	        return new AnimationParamaters(10, .05f);
        }
        
            
        
    }
}
